package com.swyc.osschat.Test.jiajiemi.des;

import com.swyc.osschat.Common.Util.Decode.DES;
import com.swyc.osschat.Common.Util.Decode.Des3;

/**
 * @description TODO
 * @Author: z156940l@outlook.com
 * @className Test
 * @Date: 2023/3/21 16:56
 */
public class Test {

    public static void main(String[] args) {
//        des();
        des3();
    }

    private static void des(){
        try {
            DES des = new DES("test/zx");
            String testStr = "这是一段des加密文字";
            String encodeStr = des.encrypt(testStr);
            System.out.println(encodeStr);

            String decodeStr = des.decrypt(encodeStr);
            System.out.println("解密文字：" + decodeStr);
        }catch (Exception e){
            e.printStackTrace();
        }
    }

    private static void des3(){
        String str = "这是一段3des加密文字";
        String encode;
        try {
            encode = Des3.encode(str);
            System.out.println("加密后的文字:" + encode);
            System.out.println("解密后的文字:" + Des3.decode(encode));
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
